/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-12-06     MBW       the first version
 */
#ifndef APPLICATIONS_FLOW_NIMING_FLOW_H_
#define APPLICATIONS_FLOW_NIMING_FLOW_H_
#include "sys.h"

#define HW_ALL 0xFF
#define SWJ_ADDR 0xAF
#define HW_TYPE 0x61
#define HW_VER 1
#define SOFT_VER 17
#define BL_VER 0
#define PT_VER 400
typedef struct
{
    //
    u8 of_update_cnt;  //¹âÁ÷Êý¾Ý¸üÐÂ¼ÆÊý¡£
    u8 alt_update_cnt; //¸ß¶ÈÊý¾Ý¸üÐÂ¼ÆÊý¡£
    //
    u8 link_sta; //Á¬½Ó×´Ì¬£º0£¬Î´Á¬½Ó¡£1£¬ÒÑÁ¬½Ó¡£
    u8 work_sta; //¹¤×÷×´Ì¬£º0£¬Òì³£¡£1£¬Õý³£
    //
    u8 of_quality;
    //
    u8 of0_sta;
    s8 of0_dx;
    s8 of0_dy;
    //
    u8 of1_sta;
    s16 of1_dx;
    s16 of1_dy;
    //
    u8 of2_sta;
    s16 of2_dx;
    s16 of2_dy;
    s16 of2_dx_fix;
    s16 of2_dy_fix;
    s16 intergral_x;
    s16 intergral_y;
    //
    u32 of_alt_cm;
    //
    float quaternion[4];
    //
    s16 acc_data_x;
    s16 acc_data_y;
    s16 acc_data_z;
    s16 gyr_data_x;
    s16 gyr_data_y;
    s16 gyr_data_z;

} _ano_of_st;

//·É¿Ø×´Ì¬

//==Êý¾ÝÉùÃ÷
extern _ano_of_st ano_of;
//==º¯ÊýÉùÃ÷
//static
static void AnoOF_DataAnl(uint8_t *data_buf, uint8_t num);

//public
void AnoOF_GetOneByte(uint8_t data);
void AnoOF_Check_State(float dT_s);

#endif /* APPLICATIONS_FLOW_NIMING_FLOW_H_ */
